// 普通操作数据库方式，如果使用到了事务，需要使用事务操作数据库方式
import { ConstantEnum } from '@libs/common/enums';

import { DepartmentConfig } from './entities/department-config.entity';

export const ProviderKey = 'DEPARTMENT_CONFIG_REPOSITORY';
export const Providers = [
  {
    provide: ProviderKey,
    useFactory: (AppDataSource) =>
      AppDataSource.getRepository(DepartmentConfig),
    inject: [ConstantEnum.DB_DATA_SOURCE],
  },
];
